package com.itheima.attendance.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.attendance.pojo.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;

/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/12/13 10:11
 */
@EqualsAndHashCode(callSuper = true)
@TableName("atte_archive_monthly_info")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArchiveMonthlyInfo extends BaseEntity implements Serializable {

    private String id;

    private String userId;

    private String atteArchiveMonthlyId;

    private String name;

    private String workNumber;
    private String mobile;
    private String atteSolution;

    private String department;
    private String workCity;
    private String yearLeaveDays;

    private String leaveDays;
    private String sickLeaveDays;
    private String longSickLeaveDays;

    private String marraiageLeaveDays;

    private String funeralLeaveDays;
    /**
     * 产假
     */
    private String maternityLeaveDays;

    private String rewardMaternityLeaveDays;

    /**
     * 陪产假
     */
    private String paternityLeaveDays;
    /**
     * 探亲假
     */
    private String homeLeavaDays;

    /**
     *工伤假
     */
    private String accidentialLeaveDays;

    private String dayOffLeaveDays;
    /**
     * 产检假
     */
    private String doctorOffLeaveDays;

    /**
     * 流产假
     */
    private String abortionLeaveDays;

    private String normalDays;

    private String outgoingDays;

    private String onBusinessDays;

    private String laterTimes;

    private String earlyTimes;

    private Integer signedTimes;
    /**
     * 日均时长（自然日）
     */
    private String hoursPerDays;

    private String hoursPerWorkDay;

    private String hoursPerRestDay;

    private String clockRate;

    private String absenceDays;

    private Integer isFullAttendanceint;

    private String actualAtteUnofficialDays;

    private String actualAtteOfficialDays;

    /**
     * 应出勤工作日
     */
    private String workingDays;
    private String salaryStandards;
    /**
     * 计薪天数调整
     */
    private String salaryAdjustmentDays;

    /**
     * 工作时长
     */
    private String workHour;

    /**
     * 计薪天数（非正式）
     */
    private String salaryUnofficialDays;
    /**
     * 计薪天数（正式）
     */
    private String salaryOfficialDays;

    /**
     * 考勤
     */
    private String archiveDate;


    public ArchiveMonthlyInfo(User user) {
        this.userId = user.getId();
        this.name = user.getUsername();
        this.workNumber = user.getWorkNumber();
        this.department = user.getDepartmentName();
        this.mobile = user.getMobile();
    }


    public void setStatisData(Map map) {
        this.normalDays = (String) map.get("at1").toString();
        this.absenceDays = (String) map.get("at2").toString();
        this.laterTimes = (String) map.get("at3").toString();
        this.earlyTimes = (String) map.get("at4").toString();
        this.leaveDays = (String) map.get("at8").toString();
        this.dayOffLeaveDays = (String) map.get("at17").toString();
    }

}
